package boxuegu.com.boxuegu2.sqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SQLiteHelper extends SQLiteOpenHelper {
    public SQLiteHelper(Context context) {
        super(context, "bxg.db", null, 1);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        //数据库升级
        db.execSQL("drop table if exists videoplaylist");
        onCreate(db);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        //创建表
        db.execSQL("create Table videoplaylist (" +
                "_id integer primary key autoincrement, " +
                "userName varchar, " +
                "id int, " +
                "videoId int, " +
                "videoPath varchar, " +
                "title varchar, " +
                "videoTitle varchar" +
                ")");
    }


}
